package org.whl.airapi.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.whl.airapi.util.response.ResponseResult;
import org.whl.airapi.util.response.ResultCode;
/**
 * @author 王浩霖
 * @version 1.0.0 2024/12/25 22:20
 */
@ControllerAdvice
@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public ResponseResult<String> defaultErrorHandler(Exception e) {
        return new ResponseResult<>(ResultCode.EXCEPTION.getCode(), e.getMessage());
    }
}
